cmake_minimum_required(VERSION 3.0.2)
project(drone_control)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS  
  roscpp
  geometry_msgs
  nav_msgs
  sensor_msgs
  std_msgs
  tf
  tf2_ros
  tf2_eigen
  uav_drone_msgs
  message_generation
  eigen_conversions
)
## eigen_conversions 是用来 实现geometry_msgs 和 eigen 类型的转换
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)



################################################
## Declare ROS messages, services and actions ##
################################################
add_message_files(
  FILES
  Person.msg
)
## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  geometry_msgs
  nav_msgs
  sensor_msgs
  std_msgs
)

catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp rospy geometry_msgs nav_msgs sensor_msgs std_msgs  message_runtime
)


###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ../common/include
)


###############################
##      声明可执行cpp文件     ##
###############################

add_library(KeyboardEvent src/lib/KeyboardEvent.cpp)

###### Main File ##########



###### Utilities File ##########

add_executable(sylu_terminal_base src/utilities/sylu_terminal_base.cpp)
add_dependencies(sylu_terminal_base drone_control_gencpp)
target_link_libraries(sylu_terminal_base ${catkin_LIBRARIES})
target_link_libraries(sylu_terminal_base KeyboardEvent)

add_executable(drone_pos_estimator src/drone_pos_estimator.cpp)
add_dependencies(drone_pos_estimator drone_control_gencpp)
target_link_libraries(drone_pos_estimator ${catkin_LIBRARIES})

add_executable(drone_sender src/drone_sender.cpp)
add_dependencies(drone_sender drone_control_gencpp)
target_link_libraries(drone_sender ${catkin_LIBRARIES})

## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h"
)

## Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY launch/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
